# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=flask-unsign
pkgver=v1.2.1.r0.g6e6e91d
pkgrel=4
epoch=1
pkgdesc='Command line tool to fetch, decode, brute-force and craft session cookies of a Flask application by guessing secret keys.'
arch=('any')
groups=('blackarch' 'blackarch-cracker' 'blackarch-webapp')
url='https://github.com/Paradoxis/Flask-Unsign'
license=('MIT')
depends=('python' 'python-flask' 'python-requests' 'python-itsdangerous'
         'python-markupsafe' 'python-werkzeug')
makedepends=('git' 'python-setuptools')
options=(!emptydirs)
source=("$pkgname::git+https://github.com/Paradoxis/Flask-Unsign.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

